var mysql = require('mysql');
var connection = mysql.createConnection({
	host: '192.168.1.139',
	user: 'root',
	password: 'root',
	database: 'wechat',
	port: '3306',
});

connection.connect(function(err){
	if(err){
		console.error('error connecting: ' + err.stack);
		return;	
	}

	console.log('connected as id: ' + connection.threadId);
});

connection.query('SELECT * FROM userOrder WHERE nickname="jianlei"',function(error, results, fields){
	if(error){
		throw error;
	};
	console.log('The solution is: ',results);
});

connection.end();
